 * MasterChief.chpl contains the global alpha and beta vars for a parallel
 * minimax with alpha-beta pruning algorithm
 * 
 * connectChapel
 * version 1.0
 */
class MasterChief{
    // alpha and beta prescribed by algorithm
    // the $ is traditional for indicating a procedure/var that might be blocked
    // from being used.
    var alpha$ : sync int;
    var beta$ : sync int;

    /**
     * Constructor for objects of class MasterChief
     */
    proc MasterChief(){
        //initialize to de facto -/+ infinity
         this.alpha$ = -100000;
         this.beta$ = 100000
    }

    /**
     * Get current alpha; Note: sync variable status means it can only be
     * accessed by one thing at a time for read and/or write
     */
    proc getAlpha():int{
        return this.alpha$;
    }
    /**
     * Get current beta
     */
    proc getBeta():int{
        return this.beta$;
    }
    
    /**
     * Set current Alpha/beta; Note: sync variable status means it can only be
     * accessed by one thing at a time for read and/or write
     */
    proc setAlpha(newAlpha : int){
        this.alpha$ = newAlpha;
    }
    proc setBeta(newBeta : int){
        this.beta$ = newBeta;
    }
}
